// 根据 id 修改用户信息
export default defineEventHandler(async (event) => {
  const id = getRouterParam(event, "id"); // 获取路由参数 id
  const body = await readBody(event); // 获取更新后的用户信息
  const res = await $fetch(`http://localhost:7001/users/${id}`, {
    method: "PUT",
    body,
    headers: {
      "Content-Type": "application/json",
    },
  });
  return res;
});
